<%namespace file="/base/helper.html" name="helper" import="reStructuredTextHelp, entityLinkingHelp, embeddingFileHelp, embeddingFormHelp"/>


<%def name="addEditForm(addEdit)">
<fieldset>
<legend>User Info</legend>
<ol>
 <li>
% if addEdit == 'edit':
  <label for="username">username <span class="emphasize">(a username cannot be changed)</span></label>
  <input id="username" maxlength="255" name="username" tabindex="1" type="text" readonly="readonly" />
% else:
  <label for="username">username * </label>
  <input id="username" maxlength="255" name="username" tabindex="1" type="text" />
% endif
 </li>
% if addEdit == 'edit':
 <li>
  <label for="password">password <span class="emphasize">(enter a new password or leave blank to retain old one)</span></label>
  <input id="password" maxlength="255" name="password" tabindex="2" type="password" />
 </li>
% else:
 <li>
  <label for="password">password * </label>
  <input id="password" maxlength="255" name="password" tabindex="2" type="password" />
 </li>
% endif
 <li>
  <label for="firstName">first name *</label>
  <input id="firstName" maxlength="255" name="firstName" tabindex="3" type="text" />
 </li>
 <li>
  <label for="lastName">last name *</label>
  <input id="lastName" maxlength="255" name="lastName" tabindex="4" type="text" />
 </li>
 <li>
  <label for="email">email *</label>
  <input id="email" maxlength="255" name="email" tabindex="5" type="text" />
 </li>
 <li>
  <label for="affiliation">affiliation</label>
  <input id="affiliation" maxlength="255" name="affiliation" tabindex="6" type="text" />
 </li>
</ol>
</fieldset>

<fieldset>
<legend>Role</legend>
<ol>
% if session['user_role'] == 'administrator':
 <li>
  <label for="role">role</label>
  ${h.select(name='role', selected_values='', options=app_globals.roles, tabindex=7)}
 </li>
% else:
 <li>
  <label for="role">role</label>
  ${h.select(name='role', selected_values='', options=[session['user_role']], tabindex=7)}
 </li>
% endif
</ol>
</fieldset>

<fieldset>
<legend>Speaker Page Content</legend>
<ol>
 <li>
  <textarea class="monospace" id="personalPageContent" cols="40" rows="15"
            name="personalPageContent" tabindex="8"></textarea>
  <p class='fullyjustified'>To give formatting and structure to the content,
  use the reStructuredText ${reStructuredTextHelp()} markup language.
  Create HTML links to OLD entities ${entityLinkingHelp()} using the syntax
  'form(a)', 'collection(b)', etc., where 'a' and 'b' are IDs.
  Embed representations of OLD Files ${embeddingFileHelp()} or Forms
  ${embeddingFormHelp()} with 'file[x]' and 'form[y]' respectively</p>
 </li>
</ol>
</fieldset>

</%def>

<%def name="settings()">
 <%
  orthographyOptions = [(u'', u'')] + [(key, \
      app_globals.OLOrthographies[key][0]) for key in \
      app_globals.OLOrthographies if app_globals.OLOrthographies[key][0]]
 %>
 <fieldset>
 <legend>Default Collection View</legend>
 <ol>
  <li>
   <p>This setting determines how a Collection's content will be displayed
   by default</p>
  ${h.select(name='collectionViewType', selected_values='', \
  options=app_globals.collectionViewTypes, tabindex=1)}
  </li>
 </ol>
 </fieldset>
 
 <fieldset>
 <legend>Input Orthography</legend>
 <ol>
  <li>
   <p>The selected orthography is that which ${c.researcher.firstName} \
   ${c.researcher.lastName} will use when entering and searching for object \
   language data.  If nothing is selected, the system-wide default input \
   orthography (${app_globals.defaultInputOrthography[0]}) will be used.</p>
   ${h.select(name='inputOrthography', selected_values='', \
   options=orthographyOptions, tabindex=2)}
  </li>
 </ol>
 </fieldset>

 <fieldset>
 <legend>Output Orthography</legend>
 <ol>
  <li>
   <p>The selected orthography is that which be used to display object \
   language data to ${c.researcher.firstName} ${c.researcher.lastName}.  If \
   nothing is selected, the system-wide default output orthography \
   (${app_globals.defaultOutputOrthography[0]}) will be used.
   </p>
   ${h.select(name='outputOrthography', selected_values='', \
   options=orthographyOptions, tabindex=3)}
  </li>
 </ol>
 </fieldset>

</%def>